smartzip

Want to know smartzip? we have a huge selection of smartzip information on alibabacloud.com

Shell custom decompression

Shell custom decompression Linux: RedHatEnterpriseLinux5 writes a script named smartzip. sh, which can automatically decompress bzip2, gzip, and zip compressed files: smartzip. shJs code #! /Bin/bashftype quot; $ (file quot; $1 quot;) quot ;... linux: Red Hat Enterprise Linux 5 writes a file named smartzip. sh script, which can automatically decompress bzip2,

Shell custom Decompression

Linux: Red Hat Enterprise Linux 5 writes a file named smartzip. sh script, which can automatically decompress bzip2, gzip, and zip compressed files: smartzip. sh Js Code #! /Bin/bash ftype = "$ (file" $1 ")" case "$ ftype" in "$1: Zip archive" *) unzip "$1 ";; "$1: gzip compressed" *) gunzip "$1"; "$1: bzip2 compressed" *) bunzip2 "$1 ";;*) echo "File $1 can not be uncompressed with

Linux Shell Script Basics Learn More (full version) 1th 2 page _linux Shell

will return: Lf.gz:gzip compressed data, deflated, original filename, Last Modified:mon Aug 23:09:18 2001, Os:unix We use this to write a script called Smartzip, which automatically extracts bzip2, gzip, and zip-type compressed files: #!/bin/sh Ftype= ' file ' Case "$ftype" in "$1:zip Archive" *) Unzip "$";; "$1:gzip Compressed" *) Gunzip "$";; "$1:bzip2 Compressed" *) Bunzip2 "$";; *) echo "File of Can not is uncompressed with

Shell Script Writing Basics

Scripting is essential for Linux testing, and the name of the shell script can be arbitrarily defined, and no suffix, such as the name can be written abc,smartzip, as long as the runtime typeThe./smartzip will be able to run the script.Do not use spaces at the beginning of each command line.Part 1th. Basics of writing Linux scripts1.1 Basic Introduction to grammar1.1.1 OpeningThe program must start with the

Shell programming Basics

identify the file type of a given file, for example, file lf.gz. The output result is: Lf.gz: gzip compressed data, deflated, original filename, last modified: Mon Aug 27 23:09:18 2001, OS: Unix We use this to write a script named smartzip, which can automatically decompress Bzip2, Gzip, and zip compressed files: #! /Bin/sh FTYPE = 'file "$1" '# Note' and 'is different case "$ FTYPE" in "$1: ZIP Archive "*) unzip "$1"; "$1: gzip COMPRESSED" *)

Linux Shell script programming Basics

effect, print the error message and exit the script. Note that the following two commands must be used: -Print the error message. -Exit the program. We use curly braces to put the two commands together as one command in the form of an anonymous function. The common function will be explained later. We can use the if expression to accomplish anything without the use of and or operators, but the use of and or operators is much more convenient. Case statement The case expression

Linux shell script basic learning (3)

will return: Lf.gz: gzip compressed data, deflated, original filename, Last modified: Mon Aug 27 23:09:18 2001, OS: Unix We use this to write a script named smartzip, which can automatically decompress bzip2, gzip, and zip compressed files: #! /Bin/sh Ftype = 'file "$1 "' Case "$ ftype" in "$1: Zip archive "*) Unzip "$1 ";; "$1: gzip compressed "*) Gunzip "$1 ";; "$1: bzip2 compressed "*) Bunzip2 "$1 ";; *) Echo "File $1 can not be uncompressed with

Linux Shell script

, for example: file lf.gz This will return: lf.gz: gzip compressed data, deflated, original filename, last modified: Mon Aug 27 23:09:18 2001, OS: Unix we used this to write a script called smartzip, which can automatically decompress Bzip2, gzip and zip compressed files: #! /Bin/sh FTYPE = 'file "$1" ' case "$ FTYPE" in "$1: ZIP Archive "*) unzip "$1"; "$1: gzip COMPRESSED" *) gunzip "$1"; "$1: bzip2 COMPRESSED "*) bunzip2" $1 "; *) ech

Linux shell script basic learning (3)

operator, but it is much more convenient to use the sum or operator.2. caseCase: The expression can be used to match a given string, not a number. case ... in...) do something here ;;esac Let's look at an example. The file command can identify the file type of a given file, for example:File lf.gzThis will return: lf.gz: gzip compressed data, deflated, original filename,last modified: Mon Aug 27 23:09:18 2001, os: Unix We use this to write a script named sma

Write the LinuxShell script

anything without the sum or operator, but it is much more convenient to use the sum or operator. A case expression can be used to match a given string, not a number. Case... in ...) Do something here ;; Esac Let's look at an example. The file command can identify the file type of a given file, for example: File lf.gz This will return: Lf.gz: gzip compressed data, deflated, original filename, Last modified: Mon Aug 27 23:09:18 2001, OS: Unix We use this to write a script named

Shell decompression script

The case expression can be used to match a given string, not a number (do not confuse switch... case in C ). Case... in...) do something here esac The file command can identify the file type of a given file, for example, file lf.gz. The output result is: Lf.gz: gzip compressed data, deflated, original filename, last modified: Mon Aug 27 23:09:18 2001, OS: Unix We use this to write a script named smartzip, which can automatically decompress Bzip2,

Linux shell script comprehensive learning

here ;; Esac Let's look at an example. The file command can identify the file type of a given file, for example: File lf.gz This will return: Lf.gz: gzip compressed data, deflated, original filename, Last modified: Mon Aug 27 23:09:18 2001, OS: Unix We use this to write a script named smartzip, which can automatically decompress bzip2, gzip, and zip compressed files: #! /Bin/sh Ftype = 'file "$1 "' Case "$ ftype" in "$1: Zip archive "*) Unzip "$1 ";;

Shell Script Authoring Tutorial

: File lf.gz This will return: Lf.gz:gzip compressed data, deflated, original filename, Last Modified:mon 23:09:18 2001, Os:unix We use this to write a script called Smartzip, which automatically extracts compressed files of bzip2, gzip, and zip types: #!/bin/sh Ftype= ' file ' $ "' Case ' $ftype ' in "$1:zip Archive" *) Unzip "$";; "$1:gzip Compressed" *) Gunzip "$";; "$1:bzip2 Compressed" *) Bunzip2 "$";; *) Error "File" can not is uncompressed with

Shell Scripting Tutorial Entry level

files for a given file, such as: File lf.gz This will return: Lf.gz:gzip compressed data, deflated, original filename, Last Modified:mon 23:09:18 2001, Os:unix We use this to write a script called Smartzip, which automatically extracts compressed files of bzip2, gzip, and zip types: #!/bin/sh Ftype= ' file ' $ "' Case ' $ftype ' in "$1:zip Archive" *) Unzip "$";; "$1:gzip Compressed" *) Gunzip "$";; "$1:bzip2 Compressed" *) Bunzip2 "$";; *) Error "Fi

Shell programming Basics

: -Print the error message. -Exit the program. We use curly braces to put the two commands together as one command in the form of an anonymous function. The common function will be explained later. We can use the if expression to accomplish anything without the use of and or operators, but the use of and or operators is much more convenient. [Edit] Case statement The case expression can be used to match a given string, not a number (do not co

Shell programming (2)

curly braces to put the two commands together as one command in the form of an anonymous function. General functions will be mentioned below. We can use the if expression to do anything without the sum or operator, but it is much more convenient to use the sum or operator. A case expression can be used to match a given string, not a number. Case... in...) Do something here ;;Esac Let's look at an example. The file command can identify the file type of a given file, for example: File lf.gz This

Shell script programming Basics

mailfolder is readable. If it is readable, it prints a line of "from" in the file. If it is not readable or the operation takes effect, print the error message and exit the script. There is a problem here, that is, we must have two commands:-Print the error message.-Exit the program.We use curly braces to put the two commands together as one command in the form of an anonymous function. General functions will be mentioned below. We can use the if expression to do anything without the sum or ope

Process Control in Shell

readable or the operation takes effect, print the error message and exit the script. Note that the following two commands must be used: -Print the error message. -Exit the program. We use curly braces to put the two commands together as one command in the form of an anonymous function. The common function will be explained later. We can use the if expression to accomplish anything without the use of and or operators, but the use of and or operators is much more convenient.3. Case statement The

Linux shell BASICS (full version) page 1/2

smartzip, which can automatically decompress bzip2, gzip, and zip compressed files: #! /Bin/sh Ftype = 'file "$1 "' Case "$ ftype" in "$1: Zip archive "*) Unzip "$1 ";; "$1: gzip compressed "*) Gunzip "$1 ";; "$1: bzip2 compressed "*) Bunzip2 "$1 ";; *) Echo "File $1 can not be uncompressed with smartzip ";; Esac You may notice that we use a special variable $1 here. The variable contains the first paramet

Shell programming Basics

write a script named smartzip, which can automatically decompress Bzip2, Gzip, and zip compressed files: #!/bin/bash ftype="$(file "$1")" case "$ftype" in "$1: Zip archive"*) unzip "$1";; "$1: gzip compressed"*) gunzip "$1";; "$1: bzip2 compressed"*) bunzip2 "$1";; *) echo "File $1 can not be uncompressed with smartzip";; esac You may notice that a special variable $1 is used above, which contain

Related Keywords:
Total Pages: 3 1 2 3 Go to: Go

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.